import axios from '../axios'
export default class contract {
  static async getContractList(params) { //列表
    let res = await axios.post('/business/contract/getContractList', params)
    return res.data
  }
  static async insertContract(params) { //新增
    let res = await axios.post('/business/contract/insertContract', params)
    return res.data
  }
  static async updateContract(params) { //修改
    let res = await axios.post('/business/contract/updateContract', params)
    return res.data
  }
  static async getContractDetail(id) { //详情
    let res = await axios.get('/business/contract/getContractDetail?id=' + id)
    return res.data
  }
  static async getdeleteContractLogic(params) { //删除
    let res = await axios.post('/business/contract/deleteContractLogic', params)
    return res.data
  }
  static async myGetCommunityList(params) { //获取小区列表
    let res = await axios.post('/business/contract/getCommunityList', params)
    return res.data
  }

  // 审批
  static async getDepartmentListByUnit(params) { //机关机构部门列表
    let res = await axios.post('/auth/department/getDepartmentListByUnit', params)
    return res.data
  }
  static async getUserListByUnit(id) { //机关机构部门列表
    let res = await axios.get(`/auth/user/getUserListByUnit?departmentId=${id}`)
    return res.data
  }
  static async getapprovalProcess(params) { //流程审批列表
    let res = await axios.post(`/business/approvalProcess/list`, params)
    return res.data
  }
  static async insertapprovalProcess(params) { //流程审批新增
    let res = await axios.post(`/business/approvalProcess/insert`, params)
    return res.data
  }
  static async detailapprovalProcess(id) { //流程审批详情
    let res = await axios.get(`/business/approvalProcess/detail?id=${id}`)
    return res.data
  }
  static async updateapprovalProcess(params) { //流程审批修改
    let res = await axios.post(`/business/approvalProcess/update`, params)
    return res.data
  }
  //单位列表级联选择器数据
  static async MygetOrganizationListByType(type) {
    let res = await axios.get(`/business/approvalProcess/getOrganizationListByType?type=${type}`)
    return res.data
  }
  //单位列表级联选择器数据
  static async MygetDepartmentListByOrgId(type, id) {
    let res = await axios.get(`/business/approvalProcess/getDepartmentListByOrgId?type=${type}&orgId=${id}`)
    return res.data
  }

  //自动审批配置页面(是否自动审批修改)
  static async MyapprovalConfigUpdate(params) {
    let res = await axios.post(`/business/approvalConfig/update`, params)
    return res.data
  }
    //自动审批配置页面(是否自动审批详情)
    static async MyapprovalConfigDetail(params) {
      let res = await axios.get(`/business/approvalConfig/detail`)
      return res.data
    }
}